package com.jt.controller;

import com.jt.annotation.RequiredLog;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/resource")
public class ResourceController {

    @RequiredLog("查询信息")
    @PreAuthorize("hasAuthority('sys:res:create')")
    @GetMapping("/select")
    public String doSelect(){
        return "select resource ok";
    }

    @PostMapping("/create")
    public String doCreate(){
        return "create resource ok";
    }

    @PreAuthorize("hasAnyAuthority('sys:res:update')")
    @PutMapping("/update")
    public String deUpdate(){
        return "update resource ok";
    }

    @DeleteMapping("/delete")
    public String deDelete(){
        return "delete resource ok";
    }

}
